package com.kunbo.cn.controller.base;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.kunbo.cn.util.date.SDate;
/**
 * 
 * <p>Title: AutoCreateCode</p>
 * <p>Description:自动生成编码 </p>
 * <p>Company: www.kunbo.cn</p> 
 * @author	yang'f
 * @date	2019年1月21日下午4:43:37
 * @version 1.0
 */
@RestController
public class AutoCreateCode {
	@RequestMapping("/generateCode")
	public String generateCode(@RequestParam("businessTableName")String tableName) {
		String prex = "";
		if(tableName.equals("bussiness_purchasing_order_manager")) {
			prex = "CGDD";
		}else if(tableName.equals("business_purchase_waybill")) {
			prex = "CGYD";
		}else if(tableName.equals("sales_order_management")) {
			prex = "XSDD";
		}else if(tableName.equals("waybill_management")) {
			prex = "XSYD";
		}else if(tableName.equals("pound_sheet_management")) {
			prex = "CGBD";
		}else if(tableName.equals("business_channel_manage")) {//通道编码
			prex = "TDBM";
		}else if(tableName.equals("business_customer_manage")) {//客户编码
			prex = "KHBM";
		}else if(tableName.equals("business_depot_manage")) {//仓库编码
			prex = "CKBM";
		}else if(tableName.equals("business_supplier_manage")) {//供应商编码
			prex = "GYSBM";
		}else if(tableName.equals("business_platform_manage")) {
			prex = "DPBM";
		}else if(tableName.equals("business_notice_of_arriva")) { //采购订单
			prex = "CGTZD";
		}else if(tableName.equals("bussiness_purchasing_order_transfer")) {
			prex = "YDZJ";
		}else if(tableName.equals("business_waybill_manage")) {//销售运单编码
			prex = "XSYD";
		}
		else if(tableName.equals("business_delivery_notice_manage")) {//销售通知单编码
			prex = "XSTZD";
		}else if(tableName.equals("business_OrderCarryOver_manage")) {//销售结转管理
			prex = "XSJZ";
		}else if(tableName.equals("business_sale_order_manage")) {//销售订单
			prex = "XSDD";
		}
		else if(tableName.equals("business_qualitys_manage")) {//销售结转
			prex = "ZJBM";
		}else if(tableName.equals("business_matter_type_manage")) {//物料类别
			prex = "WLT";
		}else if(tableName.equals("business_materials_manage")) {//物料
			prex = "WL";
		}else if(tableName.equals("vehicle_management")) { //车辆
			prex = "CL";
		}else if(tableName.equals("driver_management")) { // 司机
			prex = "SJ";
		}else if(tableName.equals("business_org_device_manage")) {//组织设备管理
			prex = "ZS";//
		}
		else if(tableName.equals("transport_unit_management")) {//运输单位管理
			prex = "YS";
		}
		
		//根据类型和日期获取对应的的 内码
		
		
		return prex+SDate.getSystemDateYMDHMSToString();
		
	}
	
	
	
	
	
	
	

}